Position detection device

ABSTRACT

A position detection device includes a first position detector, a second position detector, and a signal generator. The first position detector includes a first magnetic field generation unit, a second magnetic field generation unit, and a first magnetic sensor. The second position detector includes a third magnetic field generation unit, a fourth magnetic field generation unit, and a second magnetic sensor. The positions of the second and fourth magnetic field generation units vary in response to variations in a detection-target position. The signal generator generates a position detection signal, which is the sum of a first detection signal generated by the first magnetic sensor and a second detection signal generated by the second magnetic sensor. Each of the first and second position detectors includes a bias magnetic field generation unit.

RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.16/117,778, filed on Aug. 30, 2018, which claims priority to JapaneseApplication 2017-210250, filed on Oct. 31, 2017, the disclosures ofwhich are hereby incorporated by reference in their entirety.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention relates to a position detection device that uses amagnetic sensor.

2. Description of the Related Art

Position detection devices using magnetic sensors have been used for avariety of applications. The position detection devices using magneticsensors will hereinafter be referred to as magnetic position detectiondevices. For example, the magnetic position detection devices are usedfor detecting a lens position in a camera module having an autofocusmechanism incorporated in a smartphone.

US 2016/0231528 A1 discloses a technique of detecting a composite vectorwith a position sensor in an autofocus mechanism in which a lens ismovably coupled to a substrate. The composite vector is generated byinteraction between a first magnetic field having a constant strength ina first direction and a second magnetic field in a second directiongenerated by a magnet that moves with the lens. The second direction isorthogonal to the first direction. According to the technique, themagnitude of the second magnetic field varies depending on the lensposition, and as a result, the angle that the composite vector formswith the second direction, which will hereinafter be referred to as thecomposite vector angle, also varies.

US 2007/0047152 A1 discloses a magnetic field detection apparatus thatuses a magnetoresistive element of spin valve structure. This apparatusincludes a bias unit for applying a bias magnetic field to themagnetoresistive element to change the characteristic of a resistancevalue of the magnetoresistive element to an external magnetic field.

According to the technique disclosed in US 2016/0231528 A1, it ispossible to detect the lens position by detecting the composite vectorangle.

According to the technique disclosed in US 2016/0231528 A1, if theposition sensor is subjected to a noise magnetic field other than thefirst and second magnetic fields, there occurs a change in the compositevector angle, which disadvantageously results in an error in a detectionvalue for the lens position.

SUMMARY OF THE INVENTION

It is an object of the present invention to provide a position detectiondevice that uses a magnetic sensor and is capable of performing positiondetection with high accuracy even when subjected to a noise magneticfield.

A position detection device of the present invention is a device fordetecting a detection-target position that varies within a predeterminedmovable range. The position detection device of the present inventionincludes a first position detector, a second position detector, and asignal generator for generating a position detection signalcorresponding to the detection-target position.

The first position detector includes a first magnetic field generationunit for generating a first magnetic field, a second magnetic fieldgeneration unit for generating a second magnetic field, and a firstmagnetic sensor. The second position detector includes a third magneticfield generation unit for generating a third magnetic field, a fourthmagnetic field generation unit for generating a fourth magnetic field,and a second magnetic sensor.

The first magnetic sensor is configured to detect, at a first detectionposition in a first reference plane, a first detection-target magneticfield and to generate a first detection signal that varies in magnitudeaccording to the direction of the first detection-target magnetic field,wherein the first detection-target magnetic field is a magnetic fieldcomponent parallel to the first reference plane. The second magneticsensor is configured to detect, at a second detection position in asecond reference plane, a second detection-target magnetic field and togenerate a second detection signal that varies in magnitude according tothe direction of the second detection-target magnetic field, wherein thesecond detection-target magnetic field is a magnetic field componentparallel to the second reference plane. The signal generator generatesthe sum of the first detection signal and the second detection signal asthe position detection signal.

The position of the second magnetic field generation unit relative tothe first magnetic field generation unit and the position of the fourthmagnetic field generation unit relative to the third magnetic fieldgeneration unit vary in response to variations in the detection-targetposition.

When the detection-target position varies, the strength of a secondmagnetic field component varies whereas none of the strength anddirection of a first magnetic field component and the direction of thesecond magnetic field component vary, wherein the first magnetic fieldcomponent is a component of the first magnetic field at the firstdetection position, the component of the first magnetic field beingparallel to the first reference plane, and the second magnetic fieldcomponent is a component of the second magnetic field at the firstdetection position, the component of the second magnetic field beingparallel to the first reference plane.

When the detection-target position varies, the strength of a fourthmagnetic field component varies whereas none of the strength anddirection of a third magnetic field component and the direction of thefourth magnetic field component vary, wherein the third magnetic fieldcomponent is a component of the third magnetic field at the seconddetection position, the component of the third magnetic field beingparallel to the second reference plane, and the fourth magnetic fieldcomponent is a component of the fourth magnetic field at the seconddetection position, the component of the fourth magnetic field beingparallel to the second reference plane.

The direction of the third magnetic field component is opposite to thedirection of the first magnetic field component. The direction of thefourth magnetic field component is opposite to the direction of thesecond magnetic field component. A variable range of the first detectionsignal corresponding to the predetermined movable range of thedetection-target position includes a first reference value, and avariable range of the second detection signal corresponding to thepredetermined movable range of the detection-target position includes asecond reference value, wherein the first reference value is an averagevalue of the maximum value and the minimum value of the first detectionsignal when the direction of the first detection-target magnetic fieldvaries over a range of 360°, and the second reference value is anaverage value of the maximum value and the minimum value of the seconddetection signal when the direction of the second detection-targetmagnetic field varies over the range of 360°.

In the position detection device of the present invention, each of thefirst magnetic sensor and the second magnetic sensor may include atleast one magnetoresistive element. The at least one magnetoresistiveelement may include a magnetization pinned layer having a magnetizationwhose direction is fixed, and a free layer having a magnetization whosedirection is variable according to the direction of the first or seconddetection-target magnetic field. In this case, the first reference planeis a plane that contains the direction of the magnetization of themagnetization pinned layer in the first magnetic sensor and thedirection of the first detection-target magnetic field. The direction ofthe first detection-target magnetic field when the first detectionsignal is of the first reference value is the same as one of twodirections orthogonal to the direction of the magnetization of themagnetization pinned layer in the first magnetic sensor. The secondreference plane is a plane that contains the direction of themagnetization of the magnetization pinned layer in the second magneticsensor and the direction of the second detection-target magnetic field.The direction of the second detection-target magnetic field when thesecond detection signal is of the second reference value is the same asone of two directions orthogonal to the direction of the magnetizationof the magnetization pinned layer in the second magnetic sensor.

In the position detection device of the present invention, a value inthe middle of the variable range of the first detection signal may bethe first reference value, and a value in the middle of the variablerange of the second detection signal may be the second reference value.

In the position detection device of the present invention, at least oneof the first position detector and the second position detector mayfurther include a bias magnetic field generation unit for generating abias magnetic field to be applied to the first or second magneticsensor. In this case, the bias magnetic field applied to at least one ofthe first magnetic sensor and the second magnetic sensor causes thevariable range of the first detection signal to include the firstreference value and causes the variable range of the second detectionsignal to include the second reference value. In this case, the strengthof the second magnetic field component and the strength of the fourthmagnetic field component corresponding to the same detection-targetposition may be different from each other in absolute value.

The first position detector may include, as the bias magnetic fieldgeneration unit, a first bias magnetic field generation unit forgenerating a first bias magnetic field to be applied to the firstmagnetic sensor, and the second position detector may include, as thebias magnetic field generation unit, a second bias magnetic fieldgeneration unit for generating a second bias magnetic field to beapplied to the second magnetic sensor. The first bias magnetic field andthe second bias magnetic field may be in directions non-parallel to eachother.

In the position detection device of the present invention, the firstmagnetic field generation unit may include a first magnet and a secondmagnet disposed at different positions. In this case, the first magneticfield may be a composite of two magnetic fields that are respectivelygenerated by the first magnet and the second magnet. The third magneticfield generation unit may include a third magnet and a fourth magnetdisposed at different positions. In this case, the third magnetic fieldmay be a composite of two magnetic fields that are respectivelygenerated by the third magnet and the fourth magnet.

The position detection device of the present invention may furtherinclude a first holding member for holding the first magnetic fieldgeneration unit and the third magnetic field generation unit, and asecond holding member for holding the second magnetic field generationunit and the fourth magnetic field generation unit, the second holdingmember being provided such that its position is variable in onedirection relative to the first holding member. In this case, the secondholding member may be configured to hold a lens, and may be providedsuch that its position is variable in a direction of an optical axis ofthe lens relative to the first holding member.

According to the position detection device of the present invention, thedirection of the third magnetic field component is opposite to thedirection of the first magnetic field component, and the direction ofthe fourth magnetic field component is opposite to the direction of thesecond magnetic field component. On the other hand, a noise magneticfield applied to the first magnetic sensor and a noise magnetic fieldapplied to the second magnetic sensor are in the same direction.Accordingly, when a noise magnetic field is applied to each of the firstand second magnetic sensors, one of the first and second detectionsignals increases whereas the other decreases. Since the presentinvention uses the sum of the first and second detection signals as theposition detection signal, variations in the position detection signalcaused by a noise magnetic field are reduced. Further, in the presentinvention, the variable range of the first detection signal includes thefirst reference value, and the variable range of the second detectionsignal includes the second reference value. This contributes to furtherreduction in the variations in the position detection signal caused by anoise magnetic field. By virtue of these features, the positiondetection device of the present invention is capable of performingposition detection with high accuracy even when subjected to a noisemagnetic field.

Other and further objects, features and advantages of the presentinvention will appear more fully from the following description.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a perspective view of a camera module including a positiondetection device according to a first embodiment of the invention.

FIG. 2 illustrates an internal schematic view of the camera module ofFIG. 1.

FIG. 3 is a side view of the principal parts of the camera module shownin FIG. 1.

FIG. 4 is a plan view of the principal parts of the camera module shownin FIG. 1.

FIG. 5 is a perspective view of a plurality of coils of a driving deviceof FIG. 1.

FIG. 6 is a side view illustrating the principal parts of the drivingdevice of FIG. 1.

FIG. 7 is a circuit diagram illustrating the circuit configuration ofthe position detection device according to the first embodiment of theinvention.

FIG. 8 is a perspective view of a portion of a resistor section of FIG.7.

FIG. 9 is an explanatory diagram illustrating the magnetizationdirection of a magnetization pinned layer in a first magnetic sensor ofthe position detection device and the directions of first and secondmagnetic field components in the first embodiment of the invention.

FIG. 10 is an explanatory diagram illustrating the magnetizationdirection of a magnetization pinned layer in a second magnetic sensor ofthe position detection device and the directions of third and fourthmagnetic field components in the first embodiment of the invention.

FIG. 11 is an explanatory diagram illustrating the first to fourthmagnetic field components in a first example.

FIG. 12 is a characteristic diagram illustrating variable ranges offirst and second target angles in the first example.

FIG. 13 is a characteristic diagram illustrating the relationshipbetween a target position and corrected detection signals when there isno noise magnetic field in the first example.

FIG. 14 is a characteristic diagram illustrating the relationshipbetween the target position and the corrected detection signals whenthere is a noise magnetic field in the first example.

FIG. 15 is a characteristic diagram illustrating the relationshipbetween the target position and a noise-induced error in the firstexample.

FIG. 16 is an explanatory diagram illustrating the first to fourthmagnetic field components in a comparative example.

FIG. 17 is a characteristic diagram illustrating the variable ranges ofthe first and second target angles in the comparative example.

FIG. 18 is a characteristic diagram illustrating the relationshipbetween the target position and the corrected detection signals whenthere is no noise magnetic field in the comparative example.

FIG. 19 is a characteristic diagram illustrating the relationshipbetween the target position and the corrected detection signals whenthere is a noise magnetic field in the comparative example.

FIG. 20 is a characteristic diagram illustrating the relationshipbetween the target position and the noise-induced error in thecomparative example.

FIG. 21 is an explanatory diagram illustrating the first to fourthmagnetic field components in a second example.

FIG. 22 is a characteristic diagram illustrating the relationshipbetween the target position and the corrected detection signals whenthere is no noise magnetic field in the second example.

FIG. 23 is a characteristic diagram illustrating the relationshipbetween the target position and the corrected detection signals whenthere is a noise magnetic field in the second example.

FIG. 24 is a characteristic diagram illustrating the relationshipbetween the target position and the noise-induced error in the secondexample.

FIG. 25 is an explanatory diagram illustrating the first to fourthmagnetic field components in a second embodiment of the invention.

FIG. 26 is a characteristic diagram illustrating the relationshipbetween the target position and the corrected detection signals whenthere is no noise magnetic field in the second embodiment of theinvention.

FIG. 27 is a characteristic diagram illustrating the relationshipbetween the target position and the corrected detection signals whenthere is a noise magnetic field in the second embodiment of theinvention.

FIG. 28 is a characteristic diagram illustrating the relationshipbetween the target position and the noise-induced error in the secondembodiment of the invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS First Embodiment

Preferred embodiments of the present invention will now be described indetail with reference to the drawings. First, reference is made to FIG.1 and FIG. 2 to describe the configuration of a camera module includinga position detection device according to a first embodiment of theinvention. FIG. 1 is a perspective view of the camera module 100. FIG. 2is a schematic internal view of the camera module 100. For ease ofunderstanding, in FIG. 2 the parts of the cameral module 100 are drawnon a different scale and in a different layout than those in FIG. 1. Thecamera module 100 constitutes, for example, a portion of a camera for asmartphone having an optical image stabilization mechanism and anautofocus mechanism, and is used in combination with an image sensor 200that uses CMOS or other similar techniques.

The camera module 100 includes a position detection device 1 accordingto the present embodiment, and a driving device 3, a lens 5, a housing 6and a substrate 7. The position detection device 1 according to thepresent embodiment is a magnetic position detection device, and is usedto detect the position of the lens 5 during automatic focusing. Thedriving device 3 is to move the lens 5. The housing 6 is to protect theposition detection device 1 and the driving device 3. The substrate 7has a top surface 7 a. FIG. 1 omits the illustration of the substrate 7,and FIG. 2 omits the illustration of the housing 6.

Now, we define U, V, and Z directions as shown in FIGS. 1 and 2. The U,V, and Z directions are orthogonal to one another. In the presentembodiment, the Z direction is a direction perpendicular to the topsurface 7 a of the substrate 7. In FIG. 2 the Z direction is the upwarddirection. The U and V directions are both parallel to the top surface 7a of the substrate 7. The opposite directions to the U, V, and Zdirections will be referred to as −U, −V, and −Z directions,respectively. As used herein, the term “above” refers to positionslocated forward of a reference position in the Z direction, and “below”refers to positions located on a side of the reference position oppositefrom “above”.

The lens 5 is disposed above the top surface 7 a of the substrate 7 insuch an orientation that the direction of its optical axis is parallelto the Z direction. The substrate 7 has an opening (not illustrated) forpassing light that has passed through the lens 5. As shown in FIG. 2,the camera module 100 is in alignment with the image sensor 200 so thatlight that has passed through the lens 5 and the non-illustrated openingwill enter the image sensor 200.

The position detection device 1 and the driving device 3 according tothe present embodiment will now be described in detail with reference toFIG. 1 to FIG. 6. FIG. 3 is a side view of the principal parts of thecamera module 100 shown in FIG. 1. FIG. 4 is a plan view of theprincipal parts of the camera module 100 shown in FIG. 1. FIG. 5 is aperspective view of a plurality of coils of the driving device 3. FIG. 6is a side view illustrating the principal parts of the driving device 3.

Here, X and Y directions are defined as shown in FIGS. 3 and 4. Both theX and Y directions are parallel to the top surface 7 a (see FIG. 2) ofthe substrate 7. The X direction is the direction rotated by 45° fromthe U direction toward the V direction. The Y direction is the directionrotated by 45° from the V direction toward the −U direction. Theopposite directions to the X and Y directions will be referred to as −Xand −Y directions, respectively. FIG. 3 is a side view of the principalparts of the camera module 100 as seen from a position forward of thecamera module 100 in the X direction.

The position detection device 1 includes a first holding member 14, asecond holding member 15, a plurality of first wires 16, and a pluralityof second wires 17. The second holding member 15 is to hold the lens 5.Although not illustrated, the second holding member 15 is shaped like ahollow cylinder so that the lens 5 is insertable in the hollow.

The second holding member 15 is provided such that its position isvariable in one direction, specifically, in the direction of the opticalaxis of the lens 5, i.e., a direction parallel to the Z direction,relative to the first holding member 14. In the present embodiment, thefirst holding member 14 is shaped like a box so that the lens 5 and thesecond holding member 15 can be accommodated therein. The plurality ofsecond wires 17 connect the first and second holding members 14 and 15and support the second holding member 15 such that the second holdingmember 15 is movable in a direction parallel to the Z direction relativeto the first holding member 14.

The first holding member 14 is provided above the top surface 7 a of thesubstrate 7 such that its position is variable relative to the substrate7 in a direction parallel to the U direction and in a direction parallelto the V direction. The plurality of first wires 16 connect thesubstrate 7 and the first holding member 14, and support the firstholding member 14 such that the first holding member 14 is movablerelative to the substrate 7 in a direction parallel to the U directionand in a direction parallel to the V direction. When the position of thefirst holding member 14 relative to the substrate 7 varies, the positionof the second holding member 15 relative to the substrate 7 also varies.

The driving device 3 includes magnets 31A, 31B, 32A, 32B, 33A, 33B, 34Aand 34B, and coils 41, 42, 43, 44, 45 and 46. The magnet 31A is locatedforward of the lens 5 in the −V direction. The magnet 32A is locatedforward of the lens 5 in the V direction. The magnet 33A is locatedforward of the lens 5 in the −U direction. The magnet 34A is locatedforward of the lens 5 in the U direction. The magnets 31B, 32B, 33B and34B are located above the magnets 31A, 32A, 33A and 34A, respectively.The magnets 31A, 31B, 32A, 32B, 33A, 33B, 34A and 34B are fixed to thefirst holding member 14.

As shown in FIG. 1, the magnets 31A, 31B, 32A and 32B are each in theshape of a rectangular solid that is long in the U direction. Themagnets 33A, 33B, 34A and 34B are each in the shape of a rectangularsolid that is long in the V direction. The magnets 31A and 32B aremagnetized in the V direction. The magnets 31B and 32A are magnetized inthe −V direction. The magnets 33A and 34B are magnetized in the Udirection. The magnets 33B and 34A are magnetized in the −U direction.In FIG. 6, the arrows drawn inside the magnets 31A and 31B indicate themagnetization directions of the magnets 31A and 31B.

The coil 41 is located between the magnet 31A and the substrate 7. Thecoil 42 is located between the magnet 32A and the substrate 7. The coil43 is located between the magnet 33A and the substrate 7. The coil 44 islocated between the magnet 34A and the substrate 7. The coil 45 islocated between the lens 5 and the magnets 31A and 31B. The coil 46 islocated between the lens 5 and the magnets 32A and 32B. The coils 41,42, 43 and 44 are fixed to the substrate 7. The coils 45 and 46 arefixed to the second holding member 15.

The coil 41 is subjected mainly to a magnetic field generated by themagnet 31A. The coil 42 is subjected mainly to a magnetic fieldgenerated by the magnet 32A. The coil 43 is subjected mainly to amagnetic field generated by the magnet 33A. The coil 44 is subjectedmainly to a magnetic field generated by the magnet 34A.

As shown in FIGS. 2, 5 and 6, the coil 45 includes a first conductorportion 45A extending along the magnet 31A in the U direction, a secondconductor portion 45B extending along the magnet 31B in the U direction,and two third conductor portions connecting the first and secondconductor portions 45A and 45B. As shown in FIGS. 2 and 5, the coil 46includes a first conductor portion 46A extending along the magnet 32A inthe U direction, a second conductor portion 46B extending along themagnet 32B in the U direction, and two third conductor portionsconnecting the first and second conductor portions 46A and 46B.

The first conductor portion 45A of the coil 45 is subjected mainly to acomponent in the V direction of the magnetic field generated by themagnet 31A. The second conductor portion 45B of the coil 45 is subjectedmainly to a component in the −V direction of a magnetic field generatedby the magnet 31B. The first conductor portion 46A of the coil 46 issubjected mainly to a component in the −V direction of the magneticfield generated by the magnet 32A. The second conductor portion 46B ofthe coil 46 is subjected mainly to a component in the V direction of amagnetic field generated by the magnet 32B.

The position detection device 1 further includes a first positiondetector 1A and a second position detector 1B. The first positiondetector 1A includes a first magnetic field generation unit 11A forgenerating a first magnetic field, a second magnetic field generationunit 12A for generating a second magnetic field, and a first magneticsensor 20A. The second position detector 1B includes a third magneticfield generation unit 11B for generating a third magnetic field, afourth magnetic field generation unit 12B for generating a fourthmagnetic field, and a second magnetic sensor 20B.

The first magnetic field generation unit 11A has two magnets disposed atdifferent positions. In the present embodiment, specifically, the firstmagnetic field generation unit 11A has the magnets 32A and 33A as theaforementioned two magnets. The first magnetic field is a composite ofthe magnetic fields that are respectively generated by the magnets 32Aand 33A. As mentioned above, the magnets 32A and 33A are fixed to thefirst holding member 14. The first magnetic field generation unit 11A isthus held by the first holding member 14.

The third magnetic field generation unit 11B has two magnets disposed atdifferent positions. In the present embodiment, specifically, the thirdmagnetic field generation unit 11B has the magnets 31A and 34A as theaforementioned two magnets. The third magnetic field is a composite ofthe magnetic fields that are respectively generated by the magnets 31Aand 34A. As mentioned above, the magnets 31A and 34A are fixed to thefirst holding member 14. The third magnetic field generation unit 11B isthus held by the first holding member 14.

The magnet 32A has an end face located at the end of the magnet 32A inthe −U direction. The magnet 33A has an end face located at the end ofthe magnet 33A in the V direction.

The second magnetic field generation unit 12A is provided such that itsposition relative to the first magnetic field generation unit 11A isvariable. In the present embodiment, the second magnetic fieldgeneration unit 12A has a magnet 13A. The second magnetic field is amagnetic field generated by the magnet 13A. The magnet 13A is in theshape of a rectangular solid. The magnet 13A is fixed to the secondholding member 15 in a space near the end face of the magnet 32A and theend face of the magnet 33A. The second magnetic field generation unit12A is thus held by the second holding member 15. When the position ofthe second holding member 15 relative to the first holding member 14varies in a direction parallel to the Z direction, the position of thesecond magnetic field generation unit 12A relative to the first magneticfield generation unit 11A also varies in the direction parallel to the Zdirection.

The magnet 31A has an end face located at the end of the magnet 31A inthe U direction. The magnet 34A has an end face located at the end ofthe magnet 34A in the −V direction.

The fourth magnetic field generation unit 12B is provided such that itsposition relative to the third magnetic field generation unit 11B isvariable. In the present embodiment, the fourth magnetic fieldgeneration unit 12B has a magnet 13B. The fourth magnetic field is amagnetic field generated by the magnet 13B. The magnet 13B is in theshape of a rectangular solid. The magnet 13B is fixed to the secondholding member 15 in a space near the end face of the magnet 31A and theend face of the magnet 34A. The fourth magnetic field generation unit12B is thus held by the second holding member 15. When the position ofthe second holding member 15 relative to the first holding member 14varies in a direction parallel to the Z direction, the position of thefourth magnetic field generation unit 12B relative to the third magneticfield generation unit 11B also varies in the direction parallel to the Zdirection.

Each of the first and second magnetic sensors 20A and 20B includes atleast one magnetoresistive (MR) element.

The first magnetic sensor 20A is configured to detect a firstdetection-target magnetic field at a first detection position in a firstreference plane, and to generate a first detection signal that varies inmagnitude according to the direction of the first detection-targetmagnetic field. The first detection-target magnetic field is a magneticfield component parallel to the first reference plane. The firstdetection-target magnetic field will hereinafter be referred to as thefirst target magnetic field MFA. The first magnetic sensor 20A is fixedto the substrate 7 at a position near the end face of the magnet 32A andthe end face of the magnet 33A. The distance from the magnet 32A to thefirst magnetic sensor 20A and the distance from the magnet 33A to thefirst magnetic sensor 20A are equal. The magnet 13A is disposed abovethe first magnetic sensor 20A.

The first detection position is a position at which the first magneticsensor 20A detects the first magnetic field and the second magneticfield. In the present embodiment, the first reference plane is a planethat contains the first detection position and is perpendicular to the Zdirection. When the position of the second magnetic field generationunit 12A relative to the first magnetic field generation unit 11Avaries, the distance between the first detection position and the secondmagnetic field generation unit 12A varies.

A component of the first magnetic field at the first detection position,the component being parallel to the first reference plane, will bereferred to the first magnetic field component MF1. A component of thesecond magnetic field at the first detection position, the componentbeing parallel to the first reference plane, will be referred to as thesecond magnetic field component MF2. When there is not any noisemagnetic field to be described later, the first target magnetic fieldMFA is a composite magnetic field of the first magnetic field componentMF1 and the second magnetic field component MF2.

The second magnetic sensor 20B is configured to detect a seconddetection-target magnetic field at a second detection position in asecond reference plane, and to generate a second detection signal thatvaries in magnitude according to the direction of the seconddetection-target magnetic field. The second detection-target magneticfield is a magnetic field component parallel to the second referenceplane. The second detection-target magnetic field will hereinafter bereferred to as the second target magnetic field MFB. The second magneticsensor 20B is fixed to the substrate 7 at a position near the end faceof the magnet 31A and the end face of the magnet 34A. The distance fromthe magnet 31A to the second magnetic sensor 20B and the distance fromthe magnet 34A to the second magnetic sensor 20B are equal. The magnet13B is disposed above the second magnetic sensor 20B.

The second detection position is a position at which the second magneticsensor 20B detects the third magnetic field and the fourth magneticfield. In the present embodiment, the second reference plane is a planethat contains the second detection position and is perpendicular to theZ direction. When the position of the fourth magnetic field generationunit 12B relative to the third magnetic field generation unit 11Bvaries, the distance between the second detection position and thefourth magnetic field generation unit 12B varies.

A component of the third magnetic field at the second detectionposition, the component being parallel to the second reference plane,will be referred to the third magnetic field component MF3. A componentof the fourth magnetic field at the second detection position, thecomponent being parallel to the second reference plane, will be referredto as the fourth magnetic field component MF4. When there is not anynoise magnetic field to be described later, the second target magneticfield MFB is a composite magnetic field of the third magnetic fieldcomponent MF3 and the fourth magnetic field component MF4.

The direction of the third magnetic field component MF3 is opposite tothe direction of the first magnetic field component MF1. The directionof the fourth magnetic field component MF4 is opposite to the directionof the second magnetic field component MF2. The first magnetic fieldcomponent MF1 and the third magnetic field component MF3 preferably havestrengths of equal absolute values.

The driving device 3 further includes a magnetic sensor 30 disposed onthe inner side of one of the coils 41 and 42 and fixed to the substrate7, and a magnetic sensor 30 disposed on the inner side of one of thecoils 43 and 44 and fixed to the substrate 7. Assume here that the twomagnetic sensors 30 are disposed on the inner sides of the coils 41 and44, respectively. As will be described later, the two magnetic sensors30 are used to adjust the position of the lens 5 to reduce the effect ofhand-induced camera shake.

The magnetic sensor 30 disposed on the inner side of the coil 41 detectsthe magnetic field generated by the magnet 31A and generates a signalcorresponding to the position of the magnet 31A. The magnetic sensor 30disposed on the inner side of the coil 44 detects the magnetic fieldgenerated by the magnet 34A and generates a signal corresponding to theposition of the magnet 34A. For example, the magnetic sensors 30 areconstructed of elements for detecting magnetic fields, such as Hallelements.

An example of the circuit configuration of the position detection device1 will now be described with reference to FIG. 7. FIG. 7 is a circuitdiagram illustrating the circuit configuration of the position detectiondevice 1. In the present embodiment, the first magnetic sensor 20A isconfigured to generate, as the first detection signal corresponding tothe direction of the first target magnetic field MFA, a signalcorresponding to an angle that the direction of the first targetmagnetic field MFA forms with a first reference direction. The firstreference direction will be described in detail later.

The second magnetic sensor 20B is configured to generate, as the seconddetection signal corresponding to the direction of the second targetmagnetic field MFB, a signal corresponding to an angle that thedirection of the second target magnetic field MFB forms with a secondreference direction. The second reference direction will be described indetail later.

As shown in FIG. 7, the first magnetic sensor 20A includes a Wheatstonebridge circuit 21A and a difference detector 22A. The second magneticsensor 20B includes a Wheatstone bridge circuit 21B and a differencedetector 22B.

Each of the Wheatstone bridge circuits 21A and 21B includes a powersupply port V configured to receive a predetermined voltage, a groundport G connected to the ground, a first output port E1, and a secondoutput port E2.

Each of the Wheatstone bridge circuits 21A and 21B further includes afirst resistor section R1, a second resistor section R2, a thirdresistor section R3, and a fourth resistor section R4. The firstresistor section R1 is provided between the power supply port V and thefirst output port E1. The second resistor section R2 is provided betweenthe first output port E1 and the ground port G. The third resistorsection R3 is provided between the power supply port V and the secondoutput port E2. The fourth resistor section R4 is provided between thesecond output port E2 and the ground port G.

The first resistor section R1 includes at least one first MR element.The second resistor section R2 includes at least one second MR element.The third resistor section R3 includes at least one third MR element.The fourth resistor section R4 includes at least one fourth MR element.

In the present embodiment, specifically, the first resistor section R1includes a plurality of first MR elements connected in series, thesecond resistor section R2 includes a plurality of second MR elementsconnected in series, the third resistor section R3 includes a pluralityof third MR elements connected in series, and the fourth resistorsection R4 includes a plurality of fourth MR elements connected inseries.

The MR elements included in each of the Wheatstone bridge circuits 21Aand 21B are spin-valve MR elements. The spin-valve MR elements eachinclude a magnetization pinned layer having a magnetization whosedirection is fixed, a free layer having a magnetization whose directionis variable according to the direction of the target magnetic field, anda gap layer disposed between the magnetization pinned layer and the freelayer. The spin-valve MR elements may be tunneling magnetoresistive(TMR) elements or giant magnetoresistive (GMR) elements. In the TMRelements, the gap layer is a tunnel barrier layer. In the GMR elements,the gap layer is a nonmagnetic conductive layer. Each spin-valve MRelement varies in resistance according to the angle that themagnetization direction of the free layer forms with the magnetizationdirection of the magnetization pinned layer, and has a minimumresistance when the foregoing angle is 0° and a maximum resistance whenthe foregoing angle is 180°. In FIG. 7, the filled arrows indicate themagnetization directions of the magnetization pinned layers of the MRelements, and the hollow arrows indicate the magnetization directions ofthe free layers of the MR elements.

In the Wheatstone bridge circuit 21A, the magnetization pinned layers ofthe MR elements in the resistor sections R1 and R4 have magnetizationsin a first direction. The magnetization pinned layers of the MR elementsin the resistor sections R2 and R3 have magnetizations in a seconddirection opposite to the first direction. The first direction will bedenoted by the symbol MP1, and the second direction will be denoted bythe symbol MP2.

In the Wheatstone bridge circuit 21A, the electric potential at theoutput port E1, the electric potential at the output port E2, and thepotential difference between the output ports E1 and E2 vary accordingto the cosine of the angle that the direction of the first targetmagnetic field MFA forms with the first direction MP1. The differencedetector 22A outputs a signal corresponding to the potential differencebetween the output ports E1 and E2 as the first detection signal S1. Thefirst detection signal S1 depends on the electric potential at theoutput port E1, the electric potential at the output port E2, and thepotential difference between the output ports E1 and E2. The firstdetection signal S1 varies according to the direction of the firsttarget magnetic field MFA, and therefore corresponds to the direction ofthe first target magnetic field MFA.

In the Wheatstone bridge circuit 21B, the magnetization pinned layers ofthe MR elements in the resistor sections R1 and R4 have magnetizationsin a third direction. The magnetization pinned layers of the MR elementsin the resistor sections R2 and R3 have magnetizations in a fourthdirection opposite to the third direction. The third direction will bedenoted by the symbol MP3, and the fourth direction will be denoted bythe symbol MP4. The third direction MP3 is the same as the seconddirection MP2. The fourth direction MP4 is the same as the firstdirection MP1.

In the Wheatstone bridge circuit 21B, the electric potential at theoutput port E1, the electric potential at the output port E2, and thepotential difference between the output ports E1 and E2 vary accordingto the cosine of the angle that the direction of the second targetmagnetic field MFB forms with the third direction MP3. The differencedetector 22B outputs a signal corresponding to the potential differencebetween the output ports E1 and E2 as the second detection signal S2.The second detection signal S2 depends on the electric potential at theoutput port E1, the electric potential at the output port E2, and thepotential difference between the output ports E1 and E2. The seconddetection signal S2 varies according to the direction of the secondtarget magnetic field MFB, and therefore corresponds to the direction ofthe second target magnetic field MFB.

As shown in FIG. 7, the position detection device 1 includes a signalgenerator 23 for generating a position detection signal S correspondingto a detection-target position. The signal generator 23 generates thesum of the first detection signal S1 and the second detection signal S2as the position detection signal S. The signal generator 23 isconstructed of an adder, for example. The position detection device 1may output, as a signal indicative of the detection-target position, theposition detection signal S itself, or a signal that is not the positiondetection signal S itself but corresponds to the position detectionsignal S, such as a normalized position detection signal or a correctedposition detection signal, which will be described later.

At least one of the first position detector 1A and the second positiondetector 1B may include a bias magnetic field generation unit forgenerating a bias magnetic field to be applied to the first magneticsensor 20A or the second magnetic sensor 20B. In the following, adescription will be given of an example where both of the first magneticsensor 20A and the second magnetic sensor 20B are provided with theirrespective bias magnetic field generation units.

In the following description, the bias magnetic field generation unit ofthe first position detector 1A will be referred to as the first biasmagnetic field generation unit HMA, and the bias magnetic fieldgeneration unit of the second position detector 1B will be referred toas the second bias magnetic field generation unit HMB. The bias magneticfield generated by the first bias magnetic field generation unit HMAwill be referred to as the first bias magnetic field BA, and the biasmagnetic field generated by the second bias magnetic field generationunit HMB will be referred to as the second bias magnetic field BB.

An example of the configuration of the resistor sections R1, R2, R3 andR4 will now be described with reference to FIG. 8. FIG. 8 is aperspective view illustrating a portion of one of the resistor sectionsR1, R2, R3 and R4. In this example, the resistor section includes aplurality of MR elements 150 connected in series. FIG. 8 shows a singleMR element 150.

The MR element 150 includes a free layer 151, a gap layer 152, amagnetization pinned layer 153, and an antiferromagnetic layer 154 whichare stacked in this order in the Z direction. The antiferromagneticlayer 154 is formed of an antiferromagnetic material, and is in exchangecoupling with the magnetization pinned layer 153 so as to fix themagnetization direction of the magnetization pinned layer 153.

It should be appreciated that the layers 151 to 154 of each MR element150 may be stacked in the reverse order to that shown in FIG. 8. Each MRelement 150 may also be configured without the antiferromagnetic layer154. In such a configuration, for example, a magnetization pinned layerof an artificial antiferromagnetic structure, which includes twoferromagnetic layers and a nonmagnetic metal layer interposed betweenthe two ferromagnetic layers, may be provided in place of theantiferromagnetic layer 154 and the magnetization pinned layer 153.

In the present embodiment, each of the first and second bias magneticfield generation units HMA and HMB includes a plurality of pairs ofmagnets 51 and 52 corresponding to the plurality of MR elements 150. Themagnets 51 and 52 making up each pair of magnets 51 and 52 are disposedopposite to each other in a direction orthogonal to the Z direction,with one MR element 150 located between the magnets 51 and 52. Each pairof magnets 51 and 52 applies a bias magnetic field to a correspondingone of the MR elements located between the magnets 51 and 52. That is,the plurality of pairs of magnets 51 and 52 apply bias magnetic fieldsto the MR elements 150 on an element-by-element basis. The bias magneticfields applied to the MR elements 150 on an element-by-element basiswill be referred to as the element-by-element bias magnetic fields.

The element-by-element bias magnetic fields applied to the MR elements150 in the first magnetic sensor 20A are in the same direction as thefirst bias magnetic field BA. The first bias magnetic field BA containsthe element-by-element bias magnetic fields applied to the MR elements150 in the first magnetic sensor 20A.

Likewise, the element-by-element bias magnetic fields applied to the MRelements 150 in the second magnetic sensor 20B are in the same directionas the second bias magnetic field BB. The second bias magnetic field BBcontains the element-by-element bias magnetic fields applied to the MRelements 150 in the second magnetic sensor 20B.

Reference is now made to FIG. 1 to FIG. 6 to describe the operation ofthe driving device 3. The driving device 3 constitutes part of opticalimage stabilization and autofocus mechanisms. Such mechanisms will bebriefly described first. A control unit (not illustrated) external tothe camera module 100 controls the driving device 3, the optical imagestabilization mechanism and the autofocus mechanism.

The optical image stabilization mechanism is configured to detecthand-induced camera shake using, for example, a gyrosensor external tothe camera module 100. Upon detection of hand-induced camera shake bythe optical image stabilization mechanism, the non-illustrated controlunit controls the driving device 3 so as to vary the position of thelens 5 relative to the substrate 7 depending on the mode of the camerashake. This stabilizes the absolute position of the lens 5 to reduce theeffect of the camera shake. The position of the lens 5 relative to thesubstrate 7 is varied in a direction parallel to the U direction orparallel to the V direction, depending on the mode of the camera shake.

The autofocus mechanism is configured to detect a state in which focusis achieved on the subject, using, for example, an image sensor 200 oran autofocus sensor. Using the driving device 3, the non-illustratedcontrol unit varies the position of the lens 5 relative to the substrate7 in a direction parallel to the Z direction so as to achieve focus onthe subject. This enables automatic focusing on the subject.

Next, a description will be given of the operation of the driving device3 related to the optical image stabilization mechanism. When currentsare passed through the coils 41 and 42 by the non-illustrated controlunit, the first holding member 14 with the magnets 31A and 32A fixedthereto moves in a direction parallel to the V direction due tointeraction between the magnetic fields generated by the magnets 31A and32A and the magnetic fields generated by the coils 41 and 42. As aresult, the lens 5 also moves in the direction parallel to the Vdirection. On the other hand, when currents are passed through the coils43 and 44 by the non-illustrated control unit, the first holding member14 with the magnets 33A and 34A fixed thereto moves in a directionparallel to the U direction due to interaction between the magneticfields generated by the magnets 33A and 34A and the magnetic fieldsgenerated by the coils 43 and 44. As a result, the lens 5 also moves inthe direction parallel to the U direction. The non-illustrated controlunit detects the position of the lens 5 by measuring signalscorresponding to the positions of the magnets 31A and 34A, which aregenerated by the two magnetic sensors 30.

Next, the operation of the driving device 3 related to the autofocusmechanism will be described. To move the position of the lens 5 relativeto the substrate 7 in the Z direction, the non-illustrated control unitpasses a current through the coil 45 such that the current flows throughthe first conductor portion 45A in the U direction and flows through thesecond conductor portion 45B in the −U direction, and passes a currentthrough the coil 46 such that the current flows through the firstconductor portion 46A in the −U direction and flows through the secondconductor portion 46B in the U direction. These currents and themagnetic fields generated by the magnets 31A, 31B, 32A and 32B cause aLorentz force in the Z direction to be exerted on the first and secondconductor portions 45A and 45B of the coil 45 and the first and secondconductor portions 46A and 46B of the coil 46. This causes the secondholding member 15 with the coils 45 and 46 fixed thereto to move in theZ direction. As a result, the lens 5 also moves in the Z direction.

To move the position of the lens 5 relative to the substrate 7 in the −Zdirection, the non-illustrated control unit passes currents through thecoils 45 and 46 in directions opposite to those in the case of movingthe position of the lens 5 relative to the substrate 7 in the Zdirection.

The function and effects of the position detection device 1 according tothe present embodiment will now be described. The position detectiondevice 1 according to the present embodiment is used to detect theposition of the lens 5 relative to the substrate 7. The position of thelens 5 relative to the substrate 7 is the detection-target position forthe position detection device 1 according to the embodiment.Hereinafter, the detection-target position will simply be referred to asthe target position. The target position varies within a predeterminedmovable range. In the present embodiment, the target position varies ina direction of the optical axis of the lens 5, that is, in a directionparallel to the Z direction.

In the present embodiment, when the target position varies, the positionof the second holding member 15 also varies relative to each of thesubstrate 7 and the first holding member 14. As previously mentioned,the first holding member 14 holds the first and third magnetic fieldgeneration units 11A and 11B, and the second holding member 15 holds thesecond and fourth magnetic field generation units 12A and 12B.Accordingly, when the target position varies, the position of the secondmagnetic field generation unit 12A relative to the first magnetic fieldgeneration unit 11A varies, and also the position of the fourth magneticfield generation unit 12B relative to the third magnetic fieldgeneration unit 11B varies.

When the target position varies, the position of each of the second andfourth magnetic field generation units 12A and 12B relative to thesubstrate 7 varies, whereas the position of each of the first and thirdmagnetic field generation units 11A and 11B relative to the substrate 7does not vary.

Therefore, when the target position varies, the strength of the secondmagnetic field component MF2 varies whereas none of the strength anddirection of the first magnetic field component MF1 and the direction ofthe second magnetic field component MF2 vary. When the strength of thesecond magnetic field component MF2 varies, the direction and strengthof the first target magnetic field MFA vary, and accordingly, the valueof the first detection signal S1 to be generated by the first magneticsensor 20A varies.

Likewise, when the target position varies, the strength of the fourthmagnetic field component MF4 varies whereas none of the strength anddirection of the third magnetic field component MF3 and the direction ofthe fourth magnetic field component MF4 vary. When the strength of thefourth magnetic field component MF4 varies, the direction and strengthof the second target magnetic field MFB vary, and accordingly, the valueof the second detection signal S2 to be generated by the second magneticsensor 20B varies.

The position detection signal S, which is the sum of the first detectionsignal S1 and the second detection signal S2, varies depending on thetarget position. The non-illustrated control unit detects the targetposition by measuring the position detection signal S.

Reference is now made to FIG. 9 to describe in detail the first andsecond directions MP1 and MP2 and the first and second magnetic fieldcomponents MF1 and MF2 for the first magnetic sensor 20A. In FIG. 9, thesymbol RP1 represents the first reference plane, and the symbol P1represents the first detection position. In FIG. 9, the arrow labeledMF1 represents the first magnetic field component MF1, the arrow labeledMF2 represents the second magnetic field component MF2, and the arrowlabeled MFA represents the first target magnetic field MFA. Further, inFIG. 9 the axis in the X direction represents the strength Hx of amagnetic field in the X direction, and the axis in the Y directionrepresents the strength Hy of a magnetic field in the Y direction.

In the present embodiment, the first magnetic field component MF1 is inthe Y direction. The second magnetic field component MF2 is in adirection different from the direction of the first magnetic fieldcomponent MF1. In the present embodiment, the second magnetic fieldcomponent MF2 is specifically in the X direction, which is orthogonal tothe direction of the first magnetic field component MF1.

When there is no noise magnetic field, the first target magnetic fieldMFA is a composite magnetic field of the first and second magnetic fieldcomponents MF1 and MF2, and therefore the direction of the first targetmagnetic field MFA is different from both of the direction of the firstmagnetic field component MF1 and the direction of the second magneticfield component MF2, and is between those directions. The variable rangeof the direction of the first target magnetic field MFA is below 180°.In the present embodiment, since the direction of the second magneticfield component MF2 is orthogonal to the direction of the first magneticfield component MF1, the variable range of the direction of the firsttarget magnetic field MFA is below 90°.

In FIG. 9, the symbols PP1 and PP2 represent two directions orthogonalto the first direction MP1 in the first reference plane RP1. Twodirections orthogonal to the second direction MP2 in the first referenceplane RP1 are also the directions PP1 and PP2. In the presentembodiment, each of the two directions PP1 and PP2 is different fromboth of the direction of the first magnetic field component MF1 and thedirection of the second magnetic field component MF2.

In the present embodiment, the first reference direction is the seconddirection MP2. Hereinafter, the angle that the direction of the firsttarget magnetic field MFA forms with the first reference direction whenseen in a clockwise direction from the first reference direction in FIG.9 will be referred to as the first target angle and denoted by symbolθA. The first target angle θA indicates the direction of the firsttarget magnetic field MFA. In the present embodiment, the first magneticsensor 20A generates the first detection signal S1 corresponding to thefirst target angle θA. The variable range of the first target angle θAcorresponding to the variable range of the direction of the first targetmagnetic field MFA will be denoted by symbol θRA.

Reference is now made to FIG. 10 to describe in detail the third andfourth directions MP3 and MP4 and the third and fourth magnetic fieldcomponents MF3 and MF4 for the second magnetic sensor 20B. In FIG. 10,the symbol RP2 represents the second reference plane, and the symbol P2represents the second detection position. In FIG. 10, the arrow labeledMF3 represents the third magnetic field component MF3, the arrow labeledMF4 represents the fourth magnetic field component MF4, and the arrowlabeled MFB represents the second target magnetic field MFB. Further, inFIG. 10 the axis in the X direction represents the strength Hx of amagnetic field in the X direction, and the axis in the Y directionrepresents the strength Hy of a magnetic field in the Y direction.

In the present embodiment, the third magnetic field component MF3 is inthe −Y direction, which is opposite to the direction of the firstmagnetic field component MF1. The fourth magnetic field component MF4 isin a direction different from the direction of the third magnetic fieldcomponent MF3. In the present embodiment, the fourth magnetic fieldcomponent MF4 is specifically in the −X direction, which is opposite tothe direction of the second magnetic field component MF2 and orthogonalto the direction of the third magnetic field component MF3.

When there is no noise magnetic field, the second target magnetic fieldMFB is a composite magnetic field of the third and fourth magnetic fieldcomponents MF3 and MF4, and therefore the direction of the second targetmagnetic field MFB is different from both of the direction of the thirdmagnetic field component MF3 and the direction of the fourth magneticfield component MF4, and is between those directions. The variable rangeof the direction of the second target magnetic field MFB is below 180°.In the present embodiment, since the direction of the fourth magneticfield component MF4 is orthogonal to the direction of the third magneticfield component MF3, the variable range of the direction of the secondtarget magnetic field MFB is below 90°.

In FIG. 10, the symbols PP3 and PP4 represent two directions orthogonalto the third direction MP3 in the second reference plane RP2. Twodirections orthogonal to the fourth direction MP4 in the secondreference plane RP2 are also the directions PP3 and PP4. In the presentembodiment, each of the two directions PP3 and PP4 is different fromboth of the direction of the third magnetic field component MF3 and thedirection of the fourth magnetic field component MF4.

In the present embodiment, the second reference direction is the fourthdirection MP4. Hereinafter, the angle that the direction of the secondtarget magnetic field MFB forms with the second reference direction whenseen in a clockwise direction from the second reference direction inFIG. 10 will be referred to as the second target angle and denoted bysymbol θB. The second target angle θB indicates the direction of thesecond target magnetic field MFB. In the present embodiment, the secondmagnetic sensor 20B generates the second detection signal S2corresponding to the second target angle θB. The variable range of thesecond target angle θB corresponding to the variable range of thedirection of the second target magnetic field MFB will be denoted bysymbol θRB.

In the light of the accuracy of production of the MR elements, theaccuracy of positioning of the magnetic sensors 20A and 20B, theaccuracy of positioning of the first to fourth magnetic field generationunits 11A, 12A, 11B and 12B or other factors, the first to fourthdirections MP1 to MP4 and the respective directions of the first tofourth magnetic field components MF1 to MF4 may be slightly differentfrom the above-described directions.

The target position will now be described. In the present embodiment,the distance between the substrate 7 and the lens 5 when the lens 5 isfarthest from the substrate 7 is referred to as the maximum distance.The target position is represented as a value obtained by subtractingthe distance between the lens 5 at any position and the substrate 7 fromthe maximum distance. In the present embodiment, the movable range ofthe target position is set in a range of 0 to 400 μm.

Now, definitions of a plurality of terms used herein will be presented.The following description assumes that there is no noise magnetic fieldunless otherwise specified.

As used herein, a first reference value refers to an average value ofthe maximum value and the minimum value of the first detection signal S1when the direction of the first target magnetic field MFA varies over arange of 360°. Likewise, a second reference value refers to an averagevalue of the maximum value and the minimum value of the second detectionsignal S2 when the direction of the second target magnetic field MFBvaries over the range of 360°. In the present embodiment, the maximumvalue and the minimum value of the second detection signal S2 when thedirection of the second target magnetic field MFB varies over the rangeof 360° are respectively equal to the maximum value and the minimumvalue of the first detection signal S1 when the direction of the firsttarget magnetic field MFA varies over the range of 360°. Further, thesecond reference value is equal to the first reference value.

A first normalized detection signal NS1 refers to a signal that isobtained by normalizing the first detection signal S1 so that itsmaximum value and minimum value when the direction of the first targetmagnetic field MFA varies over the range of 360° respectively correspondto 1 and −1. The value zero of the first normalized detection signal NS1corresponds to the first reference value mentioned above.

Likewise, a second normalized detection signal NS2 refers to a signalthat is obtained by normalizing the second detection signal S2 so thatits maximum value and minimum value when the direction of the secondtarget magnetic field MFB varies over the range of 360° respectivelycorrespond to 1 and −1. The value zero of the second normalizeddetection signal NS2 corresponds to the second reference value mentionedabove.

A normalized position detection signal NS refers to the sum of the firstnormalized detection signal NS1 and the second normalized detectionsignal NS2. The normalized position detection signal NS corresponds to asignal that is obtained by normalizing the position detection signal Sin the same manner as the normalizations of the first and seconddetection signals S1 and S2 described above.

The first normalized detection signal NS1, the second normalizeddetection signal NS2 and the normalized position detection signal NS arecollectively referred to as normalized detection signals.

A first corrected detection signal CS1 refers to a signal that isobtained by correcting the first normalized detection signal NS1 byadding an offset thereto as necessary so that the value of the firstnormalized detection signal NS1 when the target position is in themiddle of its movable range corresponds to zero.

Likewise, a second corrected detection signal CS2 refers to a signalthat is obtained by correcting the second normalized detection signalNS2 by adding an offset thereto as necessary so that the value of thesecond normalized detection signal NS2 when the target position is inthe middle of its movable range corresponds to zero.

A corrected position detection signal CS refers to the sum of the firstcorrected detection signal CS1 and the second corrected detection signalCS2.

The first corrected detection signal CS1, the second corrected detectionsignal CS2 and the corrected position detection signal CS arecollectively referred to as corrected detection signals.

For each of the first detection signal S1, the second detection signalS2 and the position detection signal S, the degree of linearity of itsvariations with respect to variations in the target position is referredto as linearity of the signal.

In the present embodiment, the variable range of the first detectionsignal S1 corresponding to the movable range of the target positionincludes the first reference value, and the variable range of the seconddetection signal S2 corresponding to the movable range of the targetposition includes the second reference value. By virtue of this, theposition detection device 1 according to the present embodiment achieveshigh linearity of the position detection signal S and is thus capable ofperforming position detection with high accuracy even when subjected toa noise magnetic field.

The reason why the above-described effect is obtained will now bedescribed. First, a description will be given of the reason why theposition detection device 1 according to the present embodiment achieveshigh linearity of the position detection signal S. The linearity of thefirst detection signal S1 is high at values near the first referencevalue, and becomes lower with increasing difference from the firstreference value. Likewise, the linearity of the second detection signalS2 is high at values near the second reference value, and becomes lowerwith increasing difference from the second reference value. Thus, byallowing the respective variable ranges of the first detection signal S1and the second detection signal S2 to include the first reference valueand the second reference value, respectively, it is possible to enhancethe linearities of the first and second detection signals S1 and S2, andas a result, it is possible to enhance the linearity of the positiondetection signal S.

Next, a description will be given of the reason why the positiondetection device 1 according to the present embodiment is capable ofperforming position detection with high accuracy even when subjected toa noise magnetic field. In the present embodiment, the direction of thethird magnetic field component MF3 is opposite to the direction of thefirst magnetic field component MF1, and the direction of the fourthmagnetic field component MF4 is opposite to the direction of the secondmagnetic field component MF2. On the other hand, a noise magnetic fieldapplied to the first magnetic sensor 20A and a noise magnetic fieldapplied to the second magnetic sensor 20B are in the same direction. Asa result, when a noise magnetic field is applied to each of the firstand second magnetic sensors 20A and 20B, one of the first and seconddetection signals S1 and S2 increases whereas the other decreases.According to the present embodiment, since the position detection signalS is the sum of the first detection signal S1 and the second detectionsignal S2, variations in the position detection signal S caused by anoise magnetic field are reduced.

Further, according to the present embodiment, since the variable rangeof the first detection signal S1 includes the first reference value andthe variable range of the second detection signal S2 includes the secondreference value, the linearities of the first and second detectionsignals S1 and S2 are high. This reduces the difference between theamount of increase of one of the first and second detection signals S1and S2 and the amount of decrease of the other when a noise magneticfield is applied to each of the first and second magnetic sensors 20Aand 20B. Accordingly, the embodiment achieves further reduction invariations in the position detection signal S caused by a noise magneticfield.

For the reasons described above, the position detection device 1according to the present embodiment achieves high linearity of theposition detection signal S and is capable of performing positiondetection with high accuracy even when subjected to a noise magneticfield.

To enhance the above-described effect, it is preferable that a value inthe middle of the variable range of the first detection signal S1 be thefirst reference value and a value in the middle of the variable range ofthe second detection signal S2 be the second reference value. To achievethis, the direction of the first target magnetic field MFA when thefirst detection signal S1 is of the first reference value is preferablythe same as one of the two directions PP1 and PP2 orthogonal to themagnetization direction of the magnetization pinned layers in the firstmagnetic sensor 20A. Likewise, the direction of the second targetmagnetic field MFB when the second detection signal S2 is of the secondreference value is preferably the same as one of the two directions PP3and PP4 orthogonal to the magnetization direction of the magnetizationpinned layers in the second magnetic sensor 20B.

For the position detection device 1, even when the strengths of thefirst and third magnetic field components MF1 and MF3 are equal to eachother in absolute value, the strengths of the second and fourth magneticfield components MF2 and MF4 corresponding to the same target positionmay differ from each other in absolute value due to, for example,limitations on the arrangement of the magnets 13A and 13B. FIG. 3illustrates one example of such a case where the magnets 13A and 13B arelocated at different positions in the Z direction. When the strengths ofthe second and fourth magnetic field components MF2 and MF4corresponding to the same target position differ from each other inabsolute value as in this example, the aforementioned condition that thevariable range of the first detection signal S1 includes the firstreference value and the variable range of the second detection signal S2includes the second reference value may not be met if no measures aretaken.

According to the present embodiment, at least one of the first andsecond position detectors 1A and 1B includes the bias magnetic fieldgeneration unit for generating a bias magnetic field to be applied tothe first or second magnetic sensor 20A or 20B. This enables theabove-described condition to be met even when the strengths of thesecond and fourth magnetic field components MF2 and MF4 corresponding tothe same target position differ from each other in absolute value. To bemore specific, by application of a bias magnetic field to at least oneof the first and second magnetic sensors 20A and 20B, at least one ofthe variable range of the first detection signal S1 and the variablerange of the second detection signal S2 varies. This enables adjustmentsso that the above-described condition can be met.

First and second examples of the position detection device 1 accordingto the present embodiment and a position detection device of acomparative example will now be described.

First Example

The first example of the position detection device 1 according to thepresent embodiment will be described. FIG. 11 is an explanatory diagramillustrating the first to fourth magnetic field components in the firstexample. In FIG. 11, the arrows labeled MF1, MF2, MF3, and MF4 indicatethe directions and strengths of the first, second, third, and fourthmagnetic field components, respectively. In the first example, thestrengths of the first and third magnetic field components MF1 and MF3are equal in absolute value, and the strengths of the second and fourthmagnetic field components MF2 and MF4 corresponding to the same targetposition are equal in absolute value.

In the first example, neither of the first and second position detectors1A and 1B includes a bias magnetic field generation unit.

In the first example, a value in the middle of the variable range of thefirst detection signal S1 is the first reference value, and a value inthe middle of the variable range of the second detection signal S2 isthe second reference value. Further, the direction of the first targetmagnetic field MFA when the first detection signal S1 is of the firstreference value is the same as the direction PP1, which is one of thetwo directions PP1 and PP2 orthogonal to the magnetization direction ofthe magnetization pinned layers in the first magnetic sensor 20A. Thedirection of the second target magnetic field MFB when the seconddetection signal S2 is of the second reference value is the same as thedirection PP3, which is one of the two directions PP3 and PP4 orthogonalto the magnetization direction of the magnetization pinned layers in thesecond magnetic sensor 20B.

By way of example, assume here that when the target position is in themiddle of its movable range, the absolute value of the strength of thesecond magnetic field component MF2 is equal to the absolute value ofthe strength of the first magnetic field component MF1, and the absolutevalue of the strength of the fourth magnetic field component MF4 isequal to the absolute value of the strength of the third magnetic fieldcomponent MF3. In this case, the first target magnetic field MFA is in adirection that is rotated clockwise by 45° from the Y direction, and thesecond target magnetic field MFB is in a direction that is rotatedclockwise by 45° from the −Y direction. Thus, in this example, themagnetization direction of the magnetization pinned layers in the firstmagnetic sensor 20A is set so that the direction PP1 coincides with thedirection rotated clockwise by 45° from the Y direction, and themagnetization direction of the magnetization pinned layers in the secondmagnetic sensor 20B is set so that the direction PP3 coincides with thedirection rotated clockwise by 45° from the −Y direction.

FIG. 12 is a characteristic diagram illustrating the variable ranges θRAand θRB of the first and second target angles θA and θB in the firstexample. In FIG. 12 the horizontal axis represents the first and secondtarget angles θA and θB, and the vertical axis represents the first andsecond normalized detection signals NS1 and NS2. As shown in FIG. 12,both of the variable range of the first normalized detection signal NS1corresponding to the variable range θRA and the variable range of thesecond normalized detection signal NS2 corresponding to the variablerange θRB include zero, which corresponds to the first and secondreference values. In the first example, specifically, a value in themiddle of the variable range of the first normalized detection signalNS1 and a value in the middle of the variable range of the secondnormalized detection signal NS2 are both zero.

FIG. 13 is a characteristic diagram illustrating the relationshipbetween the target position and the corrected detection signals whenthere is no noise magnetic field in the first example. In FIG. 13 thehorizontal axis represents the target position, and the vertical axisrepresents the first corrected detection signal CS1, the secondcorrected detection signal CS2, and the corrected position detectionsignal CS.

FIG. 14 is a characteristic diagram illustrating the relationshipbetween the target position and the corrected detection signals whenthere is a noise magnetic field in the first example. In FIG. 14 thehorizontal axis represents the target position, and the vertical axisrepresents the first corrected detection signal CS1, the secondcorrected detection signal CS2, and the corrected position detectionsignal CS. Here, the noise magnetic field is assumed to contain acomponent in the X direction.

FIG. 15 is a characteristic diagram illustrating the relationshipbetween the target position and a noise-induced error in the firstexample. The noise-induced error is a value obtained by subtracting thecorrected position detection signal CS when there is no noise magneticfield from the corrected position detection signal CS when there is anoise magnetic field.

In the first example, as seen from FIGS. 13 and 14, the correctedposition detection signal CS has high linearity regardless of whether anoise magnetic field is present or not. Further, as shown in FIG. 15,the noise-induced error is sufficiently small relative to the extent ofthe variable range of the corrected position detection signal CScorresponding to the movable range of the target position. Thisindicates that the first example achieves the above-described effect ofthe position detection device 1 according to the present embodiment.

Comparative Example

Next, a description will be given of a position detection device of acomparative example. FIG. 16 is an explanatory diagram similar to FIG.11, illustrating the first to fourth magnetic field components MF1, MF2,MF3 and MF4 in the comparative example. In the comparative example, theabsolute value of the strength of the second magnetic field componentMF2 and the absolute value of the strength of the fourth magnetic fieldcomponent MF4 corresponding to the same target position are larger thanin the first example. Further, in the comparative example, the absolutevalue of the strength of the second magnetic field component MF2 and theabsolute value of the strength of the fourth magnetic field componentMF4 corresponding to the same target position are different from eachother, the latter being larger than the former. Further, in thecomparative example, neither of the first and second position detectors1A and 1B includes the bias magnetic field generation unit. Theconfiguration of the position detection device of the comparativeexample is otherwise the same as that of the first example.

FIG. 17 is a characteristic diagram similar to FIG. 12, illustrating thevariable ranges θRA and θRB of the first and second target angles θA andθB in the comparative example. In the comparative example, the lowerlimit of the variable range of the first normalized detection signal NS1corresponding to the variable range θRA is zero. Further, the variablerange of the second normalized detection signal NS2 corresponding to thevariable range θRB does not include zero.

FIG. 18 is a characteristic diagram similar to FIG. 13, illustrating therelationship between the target position and the corrected detectionsignals when there is no noise magnetic field in the comparativeexample.

FIG. 19 is a characteristic diagram similar to FIG. 14, illustrating therelationship between the target position and the corrected detectionsignals when there is a noise magnetic field in the comparative example.The noise magnetic field is the same as that in the first example.

FIG. 20 is a characteristic diagram similar to FIG. 15, illustrating therelationship between the target position and the noise-induced error inthe comparative example.

As shown in FIG. 20, the noise-induced error in the comparative exampleis larger than in the first example. The noise-induced error in thecomparative example is so large that it is non-negligible relative tothe extent of the variable range of the corrected position detectionsignal CS corresponding to the movable range of the target position. Theposition detection device of the comparative example is thus incapableof performing position detection with high accuracy when subjected to anoise magnetic field.

Second Example

Next, a description will be given of a second example of the positiondetection device 1. FIG. 21 is an explanatory diagram similar to FIG.11, illustrating the first to fourth magnetic field components MF1, MF2,MF3 and MF4 in the second example. The first to fourth magnetic fieldcomponents MF1, MF2, MF3 and MF4 in the second example are the same asthose in the comparative example.

In the second example, both of the first and second position detectors1A and 1B include their respective bias magnetic field generation units.As shown in FIG. 21, the first bias magnetic field BA is in the −Xdirection. The absolute value of the strength of the first bias magneticfield BA is equal to the absolute value of the strength of the secondmagnetic field component MF2 of the second example minus the absolutevalue of the strength of the second magnetic field component MF2 of thefirst example. The second bias magnetic field BB is in the X direction.The absolute value of the strength of the second bias magnetic field BBis equal to the absolute value of the strength of the fourth magneticfield component MF4 of the second example minus the absolute value ofthe strength of the fourth magnetic field component MF4 of the firstexample. The absolute value of the strength of the second bias magneticfield BB is different from the absolute value of the strength of thefirst bias magnetic field BA. The configuration of the second example ofthe position detection device 1 is otherwise the same as that of thefirst example.

The variable ranges θRA and θRB of the first and second target angles θAand θB in the second example are the same or almost the same as thevariable ranges θRA and θRB in the first example (see FIG. 12),respectively.

FIG. 22 is a characteristic diagram similar to FIG. 13, illustrating therelationship between the target position and the corrected detectionsignals when there is no noise magnetic field in the second example.

FIG. 23 is a characteristic diagram similar to FIG. 14, illustrating therelationship between the target position and the corrected detectionsignals when there is a noise magnetic field in the second example. Thenoise magnetic field is the same as that in the first example.

FIG. 24 is a characteristic diagram similar to FIG. 15, illustrating therelationship between the target position and the noise-induced error inthe second example.

In the second example, as seen from FIGS. 22 and 23, the correctedposition detection signal CS has high linearity regardless of whether anoise magnetic field is present or not. Further, as shown in FIG. 24,the noise-induced error is sufficiently small relative to the extent ofthe variable range of the corrected position detection signal CScorresponding to the movable range of the target position. Thisindicates that the second example achieves the above-described effect ofthe position detection device 1 according to the present embodiment.

Second Embodiment

A position detection device 1 according to a second embodiment of theinvention will now be described. In the position detection device 1according to the second embodiment, the first and second bias magneticfields BA and BB are different from those in the second example of thefirst embodiment. In the second embodiment, the direction of the firstbias magnetic field BA and the direction of the second bias magneticfield BB are non-parallel to each other.

FIG. 25 is an explanatory diagram similar to FIG. 11, illustrating thefirst to fourth magnetic field components MF1, MF2, MF3 and MF4 in thepresent embodiment. The first to fourth magnetic field components MF1,MF2, MF3 and MF4 in the present embodiment are the same as those in thesecond example of the first embodiment.

In the present embodiment, as shown in FIG. 25, the first bias magneticfield BA contains a component in the −X direction and a component in the−Y direction. The absolute value of the strength of the component in the−X direction of the first bias magnetic field BA is equal to theabsolute value of the strength of the first bias magnetic field BA inthe second example of the first embodiment.

Further, in the present embodiment, the second bias magnetic field BBcontains a component in the X direction and a component in the Ydirection. The absolute value of the strength of the component in the Xdirection of the second bias magnetic field BB is equal to the absolutevalue of the strength of the second bias magnetic field BB in the secondexample of the first embodiment.

The absolute value of the strength of the component in the Y directionof the second bias magnetic field BB is equal to the absolute value ofthe strength of the component in the −Y direction of the first biasmagnetic field BA.

In the present embodiment, the magnetization directions of themagnetization pinned layers in the first and second magnetic sensors 20Aand 20B are set in consideration of the bias magnetic fields BA and BBso that the direction PP1 will coincide with the direction of the firsttarget magnetic field MFA when the target position is in the middle ofits movable range and the direction PP3 will coincide with the directionof the second target magnetic field MFB when the target position is inthe middle of its movable range.

The configuration of the position detection device 1 according to thepresent embodiment is otherwise the same as that of the second exampleof the position detection device 1 according to the first embodiment.

The variable ranges θRA and θRB of the first and second target angles θAand θB in the present embodiment may be the same or almost the same asthe variable ranges θRA and θRB (see FIG. 12) in the first example ofthe first embodiment, respectively.

FIG. 26 is a characteristic diagram similar to FIG. 13, illustrating therelationship between the target position and the corrected detectionsignals when there is no noise magnetic field in the present embodiment.

FIG. 27 is a characteristic diagram similar to FIG. 14, illustrating therelationship between the target position and the corrected detectionsignals when there is a noise magnetic field in the present embodiment.The noise magnetic field is the same as that in the first example of thefirst embodiment.

FIG. 28 is a characteristic diagram similar to FIG. 15, illustrating therelationship between the target position and the noise-induced error inthe present embodiment.

In the present embodiment, as seen from FIGS. 26 and 27, the correctedposition detection signal CS has high linearity regardless of whether anoise magnetic field is present or not. Further, as shown in FIG. 28,the noise-induced error is sufficiently small relative to the extent ofthe variable range of the corrected position detection signal CScorresponding to the movable range of the target position. Thisindicates that the position detection device 1 according to the presentembodiment provides the same effect as that of the position detectiondevice 1 according to the first embodiment.

Further, as is apparent from comparison between FIGS. 13 and 26, thepresent embodiment shows a larger gradient of change in the correctedposition detection signal CS versus the change in the target position,compared with the first example of the first embodiment. The gradientcorresponds to the sensitivity of the position detection device 1. Thegradient varies according to the absolute value of the strength of thecomponent in the −Y direction of the first bias magnetic field BA andthe absolute value of the strength of the component in the Y directionof the second bias magnetic field BB. According to the presentembodiment, it is thus possible to adjust the sensitivity of theposition detection device 1 by changing the aforementioned absolutevalues.

In the present embodiment, the first bias magnetic field BA may containa component in the Y direction instead of the component in the −Ydirection, and the second bias magnetic field BB may contain a componentin the −Y direction instead of the component in the Y direction.

Further, in the present embodiment, the absolute value of the strengthof the first magnetic field component MF1 and the absolute value of thestrength of the third magnetic field component MF3 may be different fromeach other. In such a case, respective components in a directionparallel to the Y direction of the first and second bias magnetic fieldsBA and BB may be made different in strength from each other so that acomposite magnetic field of the first magnetic field component MF1 andthe component in the direction parallel to the Y direction of the firstbias magnetic field BA and a composite magnetic field of the thirdmagnetic field component MF3 and the component in the direction parallelto the Y direction of the second bias magnetic field BB will be inmutually opposite directions and have equal absolute values.

The configuration, operation and effects of the present embodiment areotherwise the same as those of the first embodiment.

The present invention is not limited to the foregoing embodiments, andvarious modifications may be made thereto. For example, as far as therequirements of the appended claims are met, the shapes and positioningof the first to fourth magnetic field generation units and thepositioning of the magnetic sensors 20A and 20B are not limited to therespective examples illustrated in the foregoing embodiments, but can befreely chosen.

Further, as far as the requirements of the appended claims are met, thedirections of the first to fourth magnetic field components may befreely chosen.

Further, each of the magnetic sensors 20A and 20B may be configuredwithout the Wheatstone bridge circuit and the difference detector. Forexample, each of the magnetic sensors 20A and 20B may be configured toinclude the power supply port V, the ground port G, the first outputport E1 and the first and second resistor sections R1 and R2, andinclude none of the second output port E2, the third and fourth resistorsections R3 and R4 and the difference detector 22. In such a case, eachof the first and second detection signals S1 and S2 is a signaldependent on the electric potential at the first output port E1.

The position detection device of the present invention is usable todetect not only a lens position but also the position of any objectmoving in a predetermined direction.

Obviously, many modifications and variations of the present inventionare possible in the light of the above teachings. Thus, it is to beunderstood that, within the scope of the appended claims and equivalentsthereof, the invention may be practiced in other embodiments than theforegoing most preferable embodiments.

What is claimed is:
 1. A position detection device for detecting adetection-target position that varies within a predetermined movablerange, comprising: a first position detector; a second positiondetector; and a signal generator for generating a position detectionsignal corresponding to the detection-target position, wherein the firstposition detector includes a first magnetic field generation unit forgenerating a first magnetic field, a second magnetic field generationunit for generating a second magnetic field, and a first magneticsensor, the second position detector includes a third magnetic fieldgeneration unit for generating a third magnetic field, a fourth magneticfield generation unit for generating a fourth magnetic field, and asecond magnetic sensor, the first magnetic sensor is configured todetect, at a first detection position in a first reference plane, afirst detection-target magnetic field and to generate a first detectionsignal that varies in magnitude according to a direction of the firstdetection-target magnetic field, wherein the first detection-targetmagnetic field is a magnetic field component parallel to the firstreference plane, the second magnetic sensor is configured to detect, ata second detection position in a second reference plane, a seconddetection-target magnetic field and to generate a second detectionsignal that varies in magnitude according to a direction of the seconddetection-target magnetic field, wherein the second detection-targetmagnetic field is a magnetic field component parallel to the secondreference plane, the signal generator generates the position detectionsignal using the first detection signal and the second detection signal,a position of the second magnetic field generation unit relative to thefirst magnetic field generation unit and a position of the fourthmagnetic field generation unit relative to the third magnetic fieldgeneration unit vary in response to variations in the detection-targetposition, a direction of a third magnetic field component is opposite toa direction of a first magnetic field component, the first magneticfield component is a component of the first magnetic field parallel tothe first reference plane at the first detection position, and the thirdmagnetic field component is a component of the third magnetic fieldparallel to the second reference plane at the second detection position,a direction of a fourth magnetic field component is opposite to adirection of a second magnetic field component, the second magneticfield component is a component of the second magnetic field parallel tothe first reference plane at the first detection position, and thefourth magnetic field component is a component of the fourth magneticfield parallel to the second reference plane at the second detectionposition, strengths of the second and fourth magnetic field componentsvary according to variations of the detection-target position, and avariable range of the first detection signal corresponding to thepredetermined movable range of the detection-target position includes afirst reference value, and a variable range of the second detectionsignal corresponding to the predetermined movable range of thedetection-target position includes a second reference value, wherein thefirst reference value is an average value of a maximum value and aminimum value of the first detection signal when the direction of thefirst detection-target magnetic field varies over a range of 360°, andthe second reference value is an average value of a maximum value and aminimum value of the second detection signal when the direction of thesecond detection-target magnetic field varies over the range of 360°. 2.The position detection device according to claim 1, wherein each of thefirst magnetic sensor and the second magnetic sensor includes at leastone magnetoresistive element, the at least one magnetoresistive elementincludes a magnetization pinned layer having a magnetization whosedirection is fixed, and a free layer having a magnetization whosedirection is variable according to the direction of the first or seconddetection-target magnetic field, the first reference plane is a planethat contains the direction of the magnetization of the magnetizationpinned layer in the first magnetic sensor and the direction of the firstdetection-target magnetic field, the direction of the firstdetection-target magnetic field when the first detection signal is ofthe first reference value is the same as one of two directionsorthogonal to the direction of the magnetization of the magnetizationpinned layer in the first magnetic sensor, the second reference plane isa plane that contains the direction of the magnetization of themagnetization pinned layer in the second magnetic sensor and thedirection of the second detection-target magnetic field, and thedirection of the second detection-target magnetic field when the seconddetection signal is of the second reference value is the same as one oftwo directions orthogonal to the direction of the magnetization of themagnetization pinned layer in the second magnetic sensor.
 3. Theposition detection device according to claim 1, wherein a value in themiddle of the variable range of the first detection signal is the firstreference value, and a value in the middle of the variable range of thesecond detection signal is the second reference value.
 4. The positiondetection device according to claim 1, wherein at least one of the firstposition detector and the second position detector further includes abias magnetic field generation unit for generating a bias magnetic fieldto be applied to the first or second magnetic sensor, and the biasmagnetic field applied to at least one of the first magnetic sensor andthe second magnetic sensor causes the variable range of the firstdetection signal to include the first reference value and causes thevariable range of the second detection signal to include the secondreference value.
 5. The position detection device according to claim 4,wherein the strength of the second magnetic field component and thestrength of the fourth magnetic field component corresponding to thesame detection-target position are different from each other in absolutevalue.
 6. The position detection device according to claim 1, whereinthe first magnetic field generation unit includes a first magnet and asecond magnet disposed at different positions, the first magnetic fieldis a composite of two magnetic fields that are respectively generated bythe first magnet and the second magnet, the third magnetic fieldgeneration unit includes a third magnet and a fourth magnet disposed atdifferent positions, and the third magnetic field is a composite of twomagnetic fields that are respectively generated by the third magnet andthe fourth magnet.
 7. The position detection device according to claim1, further comprising a first holding member for holding the firstmagnetic field generation unit and the third magnetic field generationunit, and a second holding member for holding the second magnetic fieldgeneration unit and the fourth magnetic field generation unit, thesecond holding member being provided such that its position is variablein one direction relative to the first holding member.
 8. The positiondetection device according to claim 7, wherein the second holding memberis configured to hold a lens, and is provided such that its position isvariable in a direction of an optical axis of the lens relative to thefirst holding member.
 9. A position detection device for detecting adetection-target position that varies within a predetermined movablerange, comprising: a first position detector; a second positiondetector; and a signal generator for generating a position detectionsignal corresponding to the detection-target position, wherein the firstposition detector includes a first magnetic field generation unit forgenerating a first magnetic field, a second magnetic field generationunit for generating a second magnetic field, a first magnetic sensor,and a first bias magnetic field generation unit for generating a firstbias magnetic field to be applied to the first magnetic sensor, thesecond position detector includes a third magnetic field generation unitfor generating a third magnetic field, a fourth magnetic fieldgeneration unit for generating a fourth magnetic field, a secondmagnetic sensor, and a second bias magnetic field generation unit forgenerating a second bias magnetic field to be applied to the secondmagnetic sensor, the first magnetic sensor is configured to detect, at afirst detection position in a first reference plane, a firstdetection-target magnetic field and to generate a first detection signalthat varies in magnitude according to a direction of the firstdetection-target magnetic field, wherein the first detection-targetmagnetic field is a magnetic field component parallel to the firstreference plane, the second magnetic sensor is configured to detect, ata second detection position in a second reference plane, a seconddetection-target magnetic field and to generate a second detectionsignal that varies in magnitude according to a direction of the seconddetection-target magnetic field, wherein the second detection-targetmagnetic field is a magnetic field component parallel to the secondreference plane, the signal generator generates the position detectionsignal using the first detection signal and the second detection signal,a position of the second magnetic field generation unit relative to thefirst magnetic field generation unit and a position of the fourthmagnetic field generation unit relative to the third magnetic fieldgeneration unit vary in response to variations in the detection-targetposition, a direction of a third magnetic field component is opposite toa direction of a first magnetic field component, the first magneticfield component is a component of the first magnetic field parallel tothe first reference plane at the first detection position, and the thirdmagnetic field component is a component of the third magnetic fieldparallel to the second reference plane at the second detection position,a direction of a fourth magnetic field component is opposite to adirection of a second magnetic field component, the second magneticfield component is a component of the second magnetic field parallel tothe first reference plane at the first detection position, and thefourth magnetic field component is a component of the fourth magneticfield parallel to the second reference plane at the second detectionposition, and strengths of the second and fourth magnetic fieldcomponents vary according to variations of the detection-targetposition.
 10. The position detection device according to claim 9,wherein the first bias magnetic field and the second bias magnetic fieldare in directions non-parallel or antiparallel to each other.
 11. Theposition detection device according to claim 9, wherein the firstmagnetic field generation unit includes a first magnet and a secondmagnet disposed at different positions, the first magnetic field is acomposite of two magnetic fields that are respectively generated by thefirst magnet and the second magnet, the third magnetic field generationunit includes a third magnet and a fourth magnet disposed at differentpositions, and the third magnetic field is a composite of two magneticfields that are respectively generated by the third magnet and thefourth magnet.
 12. The position detection device according to claim 9,further comprising a first holding member for holding the first magneticfield generation unit and the third magnetic field generation unit, anda second holding member for holding the second magnetic field generationunit and the fourth magnetic field generation unit, the second holdingmember being provided such that its position is variable in onedirection relative to the first holding member.
 13. The positiondetection device according to claim 12, wherein the second holdingmember is configured to hold a lens, and is provided such that itsposition is variable in a direction of an optical axis of the lensrelative to the first holding member.
 14. A magnetic field detectiondevice, comprising: a first detector; a second detector; and a signalgenerator for generating a detection signal, wherein the first detectorincludes a first magnetic field generation unit for generating a firstmagnetic field, a second magnetic field generation unit for generating asecond magnetic field, and a first magnetic sensor, the second detectorincludes a third magnetic field generation unit for generating a thirdmagnetic field, a fourth magnetic field generation unit for generating afourth magnetic field, and a second magnetic sensor, the first magneticsensor is configured to detect, at a first detection position in a firstreference plane, a first detection-target magnetic field and to generatea first signal that varies in magnitude according to a direction of thefirst detection-target magnetic field, wherein the firstdetection-target magnetic field is a magnetic field component parallelto the first reference plane, the second magnetic sensor is configuredto detect, at a second detection position in a second reference plane, asecond detection-target magnetic field and to generate a second signalthat varies in magnitude according to a direction of the seconddetection-target magnetic field, wherein the second detection-targetmagnetic field is a magnetic field component parallel to the secondreference plane, the signal generator generates the detection signalusing the first signal and the second signal, the first detection-targetmagnetic field is a composite magnetic field of a first magnetic fieldcomponent and a second magnetic field component, the first magneticfield component is a component of the first magnetic field parallel tothe first reference plane at the first detection position, and thesecond magnetic field component is a component of the second magneticfield parallel to the first reference plane at the first detectionposition, the second detection-target magnetic field is a compositemagnetic field of a third magnetic field component and a fourth magneticfield component, the third magnetic field component is a component ofthe third magnetic field parallel to the second reference plane at thesecond detection position, and the fourth magnetic field component is acomponent of the fourth magnetic field parallel to the second referenceplane at the second detection position, a direction of a third magneticfield component is opposite to a direction of a first magnetic fieldcomponent, a direction of a fourth magnetic field component is oppositeto a direction of a second magnetic field component, the direction ofthe first detection-target magnetic field varies according to variationsin a strength of the second magnetic field component, the direction ofthe second detection-target magnetic field varies according tovariations in a strength of the fourth magnetic field component, and avariable range of the first signal includes a first reference value, anda variable range of the second signal includes a second reference value,wherein the first reference value is an average value of a maximum valueand a minimum value of the first signal when the direction of the firstdetection-target magnetic field varies over a range of 360°, and thesecond reference value is an average value of a maximum value and aminimum value of the second signal when the direction of the seconddetection-target magnetic field varies over the range of 360°.
 15. Themagnetic field detection device according to claim 14, wherein each ofthe first magnetic sensor and the second magnetic sensor includes atleast one magnetoresistive element, the at least one magnetoresistiveelement includes a magnetization pinned layer having a magnetizationwhose direction is fixed, and a free layer having a magnetization whosedirection is variable according to the direction of the first or seconddetection-target magnetic field, the first reference plane is a planethat contains the direction of the magnetization of the magnetizationpinned layer in the first magnetic sensor and the direction of the firstdetection-target magnetic field, the direction of the firstdetection-target magnetic field when the first signal is of the firstreference value is the same as one of two directions orthogonal to thedirection of the magnetization of the magnetization pinned layer in thefirst magnetic sensor, the second reference plane is a plane thatcontains the direction of the magnetization of the magnetization pinnedlayer in the second magnetic sensor and the direction of the seconddetection-target magnetic field, and the direction of the seconddetection-target magnetic field when the second signal is of the secondreference value is the same as one of two directions orthogonal to thedirection of the magnetization of the magnetization pinned layer in thesecond magnetic sensor.
 16. The magnetic field detection deviceaccording to claim 14, wherein a value in the middle of the variablerange of the first signal is the first reference value, and a value inthe middle of the variable range of the second signal is the secondreference value.
 17. The magnetic field detection device according toclaim 14, wherein at least one of the first detector and the seconddetector further includes a bias magnetic field generation unit forgenerating a bias magnetic field to be applied to the first or secondmagnetic sensor, and the bias magnetic field applied to at least one ofthe first magnetic sensor and the second magnetic sensor causes thevariable range of the first signal to include the first reference valueand causes the variable range of the second signal to include the secondreference value.
 18. The magnetic field detection device according toclaim 17, wherein the strength of the second magnetic field componentand the strength of the fourth magnetic field component corresponding tothe same detection-target position are different from each other inabsolute value.
 19. The magnetic field detection device according toclaim 14, wherein the first magnetic field generation unit includes afirst magnet and a second magnet disposed at different positions, thefirst magnetic field is a composite of two magnetic fields that arerespectively generated by the first magnet and the second magnet, thethird magnetic field generation unit includes a third magnet and afourth magnet disposed at different positions, and the third magneticfield is a composite of two magnetic fields that are respectivelygenerated by the third magnet and the fourth magnet.
 20. A magneticfield detection device, comprising: a first detector; a second detector;and a signal generator for generating a detection signal, wherein thefirst detector includes a first magnetic field generation unit forgenerating a first magnetic field, a second magnetic field generationunit for generating a second magnetic field, a first magnetic sensor,and a first bias magnetic field generation unit for generating a firstbias magnetic field to be applied to the first magnetic sensor, thesecond detector includes a third magnetic field generation unit forgenerating a third magnetic field, a fourth magnetic field generationunit for generating a fourth magnetic field, a second magnetic sensor,and a second bias magnetic field generation unit for generating a secondbias magnetic field to be applied to the second magnetic sensor, thefirst magnetic sensor is configured to detect, at a first detectionposition in a first reference plane, a first detection-target magneticfield and to generate a first signal that varies in magnitude accordingto a direction of the first detection-target magnetic field, wherein thefirst detection-target magnetic field is a magnetic field componentparallel to the first reference plane, the second magnetic sensor isconfigured to detect, at a second detection position in a secondreference plane, a second detection-target magnetic field and togenerate a second signal that varies in magnitude according to adirection of the second detection-target magnetic field, wherein thesecond detection-target magnetic field is a magnetic field componentparallel to the second reference plane, the signal generator generatesthe detection signal using the first signal and the second signal, thefirst detection-target magnetic field is a composite magnetic field of afirst magnetic field component and a second magnetic field component,the first magnetic field component is a component of the first magneticfield parallel to the first reference plane at the first detectionposition, and the second magnetic field component is a component of thesecond magnetic field parallel to the first reference plane at the firstdetection position, the second detection-target magnetic field is acomposite magnetic field of a third magnetic field component and afourth magnetic field component, the third magnetic field component is acomponent of the third magnetic field parallel to the second referenceplane at the second detection position, and the fourth magnetic fieldcomponent is a component of the fourth magnetic field parallel to thesecond reference plane at the second detection position, a direction ofa third magnetic field component is opposite to a direction of a firstmagnetic field component, a direction of a fourth magnetic fieldcomponent is opposite to a direction of a second magnetic fieldcomponent, the direction of the first detection-target magnetic fieldvaries according to variations in a strength of the second magneticfield component, and the direction of the second detection-targetmagnetic field varies according to variations in a strength of thefourth magnetic field component.
 21. The magnetic field detection deviceaccording to claim 20, wherein the first bias magnetic field and thesecond bias magnetic field are in directions non-parallel orantiparallel to each other.
 22. The magnetic field detection deviceaccording to claim 20, wherein the first magnetic field generation unitincludes a first magnet and a second magnet disposed at differentpositions, the first magnetic field is a composite of two magneticfields that are respectively generated by the first magnet and thesecond magnet, the third magnetic field generation unit includes a thirdmagnet and a fourth magnet disposed at different positions, and thethird magnetic field is a composite of two magnetic fields that arerespectively generated by the third magnet and the fourth magnet.